﻿@model List<BTKERP.Model.RequisitionDeliveryMaster>
@{
    ViewBag.Title = "Requisition Delivery";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Requisition Delivery</h2>

<form id="searchForm" name="searchForm" method="post" >
<table class="editor W800">
    <thead>
        <tr>
            <td class="left" colspan="4">Requision Search</td>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td class="right W100">
                To Warehouse 
            </td>
            <td class="left W300">
                 @Html.DropDownList("house", ViewData["WareHouseLisst"] as IEnumerable<SelectListItem>, new { @class = "W200 Margin10" })
            </td>
            <td class="right W100">
                Requision #
            </td>
            <td class="left W300">
                <input type="text" class="W200 Margin10" id="reqno" name="reqno"/>
            </td>
        </tr>
        <tr>
            <td class="right">
                DO No.
            </td>
            <td class="left">
                <input type="text" class="W200 Margin10" id="dono" name="dono"/>
            </td>
            <td class="right">
                Requision By
            </td>
            <td class="left">
                @Html.DropDownList("UserList",ViewData["UserList"] as IEnumerable<SelectListItem>,"Please select" ,new { @class="W200 Margin10"})
            </td>
        </tr>
        <tr>
            <td class="right">
                Status
            </td>
            <td class="left" colspan="3">
                 <select class="W200 Margin10"  name="status" id="status">
                    <option value="0">Pending</option>
                    <option value="1">Voied</option>
                    <option value="2">Processing</option>
                    <option value="3">Delived</option>
                </select>
            </td>
        </tr>
        <tr>
            <td colspan="4" class="center">
               <input type="button" class="btn-blue" value="Search" onclick="$('#searchForm').submit();" />
                <input type="button" class="btn-red" value="Cancel" onclick="$('#searchForm')[0].reset();"/>
            </td>
        </tr>  
    </tbody>
</table>
</form>

<hr />
<table class="display stylized">
    <tr>
        <th>To Warehouse</th>
        <th>DO No.</th>
        <th>Req'd No.</th>
        <th>Req'd By</th>
        <th>To Delivery Date</th>
        <th>Requisition Date</th>
        <th>Req'd Total</th>
        <th>Status</th>
        <th>Action</th>
    </tr>
    @if (Model != null && Model.Count > 0)
    {
        foreach (var master in Model)
        {
            <tr>
                <td>@BTKERP.MVCWeb.AppCode.DataRefHelper.GetWarehouseById(master.WarehouseId)</td>
                <td>@master.DOCode</td>
                <td>@master.RequisitionCode</td>
                <td>@master.RequisitionedBy</td>
                <td>@master.DeliveryDate.ToString("MM/dd/yyyy")</td>
                <td>@master.RequisitionDate.ToString("MM/dd/yyyy")</td>
                <td>@master.DeliveryValue.ToString("N0")</td>
                <td>@BTKERP.MVCWeb.AppCode.DataRefHelper.GetDOStatus(master.Status)</td>
                <td><a href="#"> Delivery </a> | <a href="#"> Void </a></td>
            </tr>
        }
    }
    else
    {
        <tr>
            <td colspan="9">No Record Found</td>
        </tr>
    }
</table>